import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: () => import('@/views/UserLoginView'),
    hidden: true
  },

  {
    path: '/User',
    name: 'User',
    component: () => import('@/views/UserView.vue'),
    children: [
      {
        path: '/User/UserInfo/',
        name: 'UserInfo',
        component: () => import('@/components/userInfo.vue'),
      },
      {
        path: '/User/carList',
        name: 'carList',
        component: () => import('@/components/carList.vue'),
      },
      {
        path: '/User/auctionEvent',
        name: 'auctionEvent',
        component: () => import('@/components/auctionEvent.vue'),
      },
      {
        path: '/User/reserve',
        name: 'reserve',
        component: () => import('@/components/reserve.vue'),
      },
      {
        path: '/User/offeredActivity',
        name: 'offeredActivity',
        component: () => import('@/components/offeredActivity.vue'),
      },
      {
        path: '/User/winningCar',
        name: 'winningCar',
        component: () => import('@/components/winningCar.vue'),
      },
    ]
  },
  {
    path: '/UserLoginView',
    component: () => import('@/views/UserLoginView.vue'),
    hidden: true
  },
  {
    path: '/UserRegisterView',
    component: () => import('@/views/UserRegisterView.vue'),
    hidden: true
  },
  {
    path: '/modifyPasswordView',
    component: () => import('@/views/modifyPasswordView.vue'),
    hidden: true
  }
]
const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
